﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyShopCD.BL;
namespace QuanLyShopCD.GUI
{
    public partial class bt_them : Form
    {
        public bt_them()
        {
            InitializeComponent();
        }
        tinh_dm dm;
        tinh_qlcd qlcd;
        private void button1_Click(object sender, EventArgs e)
        {
            qlcd = new tinh_qlcd(txtmacd, txttencd, txt_loaidm, txtdongia, dataGridView1);
            qlcd.them();
        }

        private void bt_sua_Click(object sender, EventArgs e)
        {
            qlcd = new tinh_qlcd(txtmacd, txttencd, txt_loaidm, txtdongia, dataGridView1);
            qlcd.sua();
        }

        private void bt_xoa_Click(object sender, EventArgs e)
        {
            qlcd = new tinh_qlcd(txtmacd, txttencd, txt_loaidm, txtdongia, dataGridView1);
            qlcd.xoa();
        }

        private void bt_them_Load(object sender, EventArgs e)
        {
            qlcd = new tinh_qlcd(txtmacd, txttencd, txt_loaidm, txtdongia, dataGridView1);
            dm = new tinh_dm();
            qlcd.hienthi();
            txt_loaidm.DataSource = dm.getDM();
            txt_loaidm.DisplayMember = "TenDM";
            txt_loaidm.ValueMember = "MaDM";
        }
    }
}
